﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfSetInnerPayPwd.aspx.cs" Inherits="msBsc.WebUi.mMall.Buyer.mfSetInnerPayPwd" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <%=getBodyBeforeJs()%>
    <!--start JS引用-->
    <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <!--end JS引用-->
    <script type="text/javascript">
        $(window).load(function () {
            $("#h_title").text("设置支付密码");
            var oparm = new jsonRow();
            oparm.AddCell("ACTION", "IsSetedPayPwd");
            ajaxComm(oparm);
        });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
        input[type=password], #selBankList {
            border: 0;
            border: 1px solid #808080;
            width: 300px;
            height: 30px;
            line-height: 30px;
        }

            input[type=password]:hover {
                border: 1px solid #0094ff;
            }

        input[type=button] {
            width: 80px;
            height: 28px;
            text-align: center;
            line-height: 28px;
            border: 0;
            background-color: #7abd54;
            color: #fff;
            font-size: 14px;
            font-family: 微软雅黑;
            cursor: pointer;
        }

            input[type=button]:hover {
                opacity: 0.8;
            }

        .bind-notice-msg {
            max-width: 840px;
            padding: 10px 15px;
            border: 1px solid #f60;
            font-family: 微软雅黑;
            font-size: 16px;
            color: #0094ff;
            margin-bottom: 20px;
            text-indent: 32px;
        }

        .content-wrap {
            width: 98%;
            margin-left: 1%;
            max-width: 840px;
            min-width: 300px;
        }

            .content-wrap span {
                display: table-cell;
                padding-right: 15px;
            }

        .content-row {
            line-height: 45px;
        }

        .bindBank-title, .bindAlipay-title {
            max-width: 840px;
            height: 35px;
            line-height: 35px;
            font-family: 微软雅黑;
            font-size: 18px;
            color: #fff;
            background-color: #0094ff;
            padding-left: 20px;
        }

        .bindBank-content, .bindAlipay-content {
            max-width: 840px;
            border: 1px solid #808080;
        }

        .bindAlipayInfo {
            margin-top: 15px;
        }

        .notice-title {
            width: 120px;
            text-align: right;
            font-family: 微软雅黑;
            font-size: 14px;
            color: #808080;
            letter-spacing: 3px;
        }

        .notice-msg {
            font-size: 12px;
            font-family: 微软雅黑;
            color: #f00;
        }

        .btnReset {
            background-color: #0094ff !important;
        }

        .ErrBorder {
            border-color: #f00 !important;
        }

        @media (max-width:470px) {
            input[type=password], #selBankList {
                width: 100%;
                min-width: 240px;
            }

            .content-row span {
                display: block;
                width: 100%;
                text-align: left;
                line-height: 35px;
                /*margin:5px auto 5px 10%;*/
            }

            .bindBank-content, .bindAlipay-content {
                padding: 0 10%;
            }

            .content-row {
                line-height: normal;
            }

            .notice-title {
                line-height: 25px !important;
            }
        }
    </style>
    <link href="/themes/mStyle1/css/public/mDjackPersonalBase.css" rel="stylesheet" />
    <link rel="stylesheet" href="/themes/mStyle1/mSearch.css" />
    <link href="/themes/mStyle1/css/home/base.css" rel="stylesheet" />
    <%--    <link rel="stylesheet" href="/themes/Style1/schList.css" />--%>
    <base target="_self" />
</head>
<body>
    <div class="viewport" style="background-color: #edeeee">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <div class="content-wrap">
            <div class="bind-notice-msg">
                支付密码的设置，可以有效的保证用户账户资金的安全。并且能够使用户快速的进行资金调动。设置支付密码时，请注意:为了保证账户的安全，请用户将支付密码和登录密码设置为两个不同的密码。
            </div>

            <div class="bindAlipayInfo">
                <div class="bindAlipay-title">设置支付密码</div>
                <div class="bindAlipay-content">
                    <div class="content-row">
                        <span class="notice-title">支付密码:</span>
                        <span class="cust-input">
                            <input type="password" id="pwdUserPayPwd" value="" placeholder="请输入支付密码" />
                        </span>
                        <span class="notice-msg notice-msg-aliaccount"></span>
                    </div>
                    <div class="content-row">
                                <span class="notice-title">确认密码:</span>
                                <span class="cust-input">
                                    <input type="password" id="pwdConfirm" value="" placeholder="请再次输入支付密码" />
                                </span>
                                <span class="notice-msg notice-msg-confirm"></span>
                            </div>
                    <div class="content-row">
                        <span class="notice-title"></span>
                        <span class="cust-input">
                            <input type="button" id="submitPayPwd" value="确认设置" />
                            <input type="button" class="btnReset" id="resetPayPwd" value="重置内容" />
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapMenuHtml() %>
    </div>


    <script type="text/javascript">
        function ResetBindInfo() {
            $("#resetPayPwd").click(function () {
                $("#pwdUserPayPwd").val("");
                ShowSuccessMsg("pwdUserPayPwd", "notice-msg-aliaccount")
            })
        }
        ResetBindInfo();

        $(function () {
            $("#submitPayPwd").click(function () {
                SetPayPwdInfo();
            })

            $("input[type=password]").keyup(function () {
                ShowSuccessMsg($(this).attr("id"), "notice-msg")
            })
        })

        function SetPayPwdInfo() {
            $("#submitPayPwd").attr("disabled", "disabled");
            $("#submitPayPwd").val("正在设置...");
            var userPayPwd = $.trim($("#pwdUserPayPwd").val());
            var confirmPwd = $.trim($("#pwdConfirm").val());

            if (IsNull(userPayPwd)) {
                ShowErrMsg("pwdUserPayPwd", "notice-msg-aliaccount", "支付密码不能为空");
                return;
            }

            if (IsNull(confirmPwd)) {
                ShowErrMsg("pwdConfirm", "notice-msg-confirm", "确认密码不能为空");
                return;
            }

            if (userPayPwd.length < 6 || userPayPwd.length > 16) {
                ShowErrMsg("pwdUserPayPwd", "notice-msg-aliaccount", "支付密码必须在6~16位之间");
                return;
            }

            if (userPayPwd != confirmPwd) {
                ShowErrMsg("pwdConfirm", "notice-msg-confirm", "支付密码与确认密码不一致");
                return;
            }

            var oparm = new jsonRow();
            oparm.AddCell("ACTION", "SetPayPwdInfo");
            oparm.AddCell("userPayPwd", userPayPwd);
            ajaxComm(oparm, null, function () {
                $("#submitPayPwd").val("确认设置");
                $("#submitPayPwd").removeAttr("disabled");
            });
        }

        function ShowErrMsg(ErrSourceId, MsgClass, MsgStr) {
            $("#" + ErrSourceId).addClass("ErrBorder")
            $("." + MsgClass).text("*" + MsgStr)
            $("#submitPayPwd").val("确认设置");
            $("#submitPayPwd").removeAttr("disabled");
        }

        function ShowSuccessMsg(SuccessSourceId, MsgClass) {
            $("." + MsgClass).text("")
            $("#" + SuccessSourceId).removeClass("ErrBorder")

        }

        function SetPayPwdSuccess() {
            alert("支付密码设置成功，请牢记支付密码。\r\n为了您的财产安全，请不要将支付密码泄露给任何人。");
            window.location.href = IsNull(GetQueryStr("ReturnUrl")) ? '/mb_TouristInfo.htm' : GetQueryStr("ReturnUrl");
        }
        $(document).ready(function () {
            $.getMessageCount();
        });
    </script>
</body>
</html>
